home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 14.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-06-12  |  3.5 KB  |  182 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. DirectionType = strip(line)
  30. line = readln(TempFile)
  31. Waves = strip(line)
  32. line = readln(TempFile)
  33. TAmount = strip(line)
  34. line = readln(TempFile)
  35. SANum = strip(line)
  36. line = readln(TempFile)
  37. SBNum = strip(line)
  38. line = readln(TempFile)
  39. CropAnswer = strip(line)
  40. call close TempFile
  41.  
  42. Frames = (End - Start)+1
  43. j=0
  44. k=0
  45. TFrames = Frames
  46. TNum = 3
  47. if TFrames > 999 then TNum = 4
  48. if TFrames > 9999 then TNum = 5
  49. if Field = 1 then TFrames = Frames*2
  50. do i = Start to End
  51.     k = k+ 1
  52.     call open TempFile,"RAM:VFXNums",W
  53.     call writeln TempFile,right(k,5,'0')
  54.     call writeln TempFile,right(Frames,5,'0')
  55.     call close TempFile
  56.     f=0
  57.     Redraw Off
  58.     j = j+ 1
  59.     FieldSet = 0
  60.     call DoIt()
  61.     Redraw On
  62.     call SaveIt()
  63.         if Field = 1 then do
  64.             Redraw Off
  65.             j = j + 1
  66.             FieldSet = 1
  67.             call DoIt()
  68.             Redraw On
  69.             call SaveIt()
  70.             end 
  71.     end
  72.     Undo On
  73. exit
  74.  
  75.  
  76.  
  77. LoadA:
  78.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  79.         Undo On
  80.         exit
  81.         end
  82.     if IAType = 0 then do
  83.         LoadBuffer PicAName Force i
  84.         if Field = 1 then do
  85.             GetMain
  86.             parse var result Name Width Height Blah
  87.             if FieldSet = 0 then do
  88.                 Hook DeInterlace
  89.                 Scale Width Height
  90.                 end
  91.             if FieldSet = 1 then do
  92.                 Hook DeInterlace
  93.                 Swap
  94.                 Scale Width Height
  95.                 end
  96.             end
  97.         end
  98.     if IAType = 1 then do
  99.         LoadBuffer PicAName Force 1
  100.         end
  101.     if IAType = 2 then do
  102.         LoadBuffer PicAName Force
  103.         end
  104.     if IAType = 3 then do
  105.         LoadBuffer PicAName""right(i,TNum,'0') Force
  106.         end
  107. return
  108.  
  109.  
  110. SaveIt:
  111.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  112.         Undo On
  113.         exit
  114.         end
  115.     if SaveType = 0 then do
  116.         call Switcher(TOSW)
  117.         call Switcher(MDV1)
  118.  
  119.         Render Go
  120.         if Field = 1 then
  121.                 call RecordAdd(SaveName,1,6,Compression)
  122.         else
  123.                 call RecordAdd(SaveName,2,6,Compression)
  124.         if j = TFrames then
  125.             call MakeIcon(SaveName,(Frames-10))
  126.         end
  127.  
  128.     if SaveType = 1 then do
  129.         if Field = 1 then do
  130.             f= f + 1
  131.             if f = 1 then
  132.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  133.             if f = 2 then do
  134.                 GetMain
  135.                 parse var result Name Width Height Blah
  136.                 Scale Width Height/2
  137.                 Swap
  138.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  139.                 Scale Width Height/2
  140.                 Hook Interlace
  141.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  142.                 f = 0
  143.                 end
  144.             end
  145.         else do
  146.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  147.             end    
  148.         end
  149.  
  150. return
  151.  
  152.  
  153. DoIt:
  154.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  155.         Undo On
  156.         exit
  157.         end
  158.     call LoadA()
  159.     GetMain
  160.     parse var result Name Width Height Blah
  161.     if CropAnswer ~= "None" then do
  162.         CropAnswer
  163.         Scale Width Height
  164.         end
  165.  
  166.     if j = 1 then myj = 1
  167.     if myj = SANum then myj = 1
  168.     Num = (myj*SBNum)-SBNum
  169.     myj = myj+1
  170.  
  171.     ChangeNum = 4
  172.     AmountNum = trunc(((j-1) * (TAmount*ChangeNum))/(TFrames-1))
  173.     if j > (TFrames/2) then
  174.         AmountNum = trunc((TAmount*ChangeNum)-((j-1) * (TAmount*ChangeNum))/(TFrames-1))
  175.     if AmountNum = 0 then AmountNum = 1
  176.     if AmountNum > TAmount then AmountNum = TAmount
  177.  
  178.     Hook Dream DirectionType AmountNum Waves Num 3 Wrap
  179. return
  180.  
  181.  
  182.